<template>
  <div>
    <el-skeleton :loading="loading" animated>
      <el-card class="mt-8px">
        <template #header>
          <div class="h-3 flex justify-between">
            <span>提测信息</span>
          </div>
        </template>
        <el-descriptions title="" :column="3" border>
          <el-descriptions-item label="提测ID" label-align="right" align="center" label-class-name="my-label"
            class-name="my-content" width="150px">
            12345
          </el-descriptions-item>
          <el-descriptions-item label="提测人" label-align="right" align="center">
            赵哲
          </el-descriptions-item>
          <el-descriptions-item label="提测时间" label-align="right" align="center">
            2023
          </el-descriptions-item>
          <el-descriptions-item label="备注" label-align="right" align="center">
            test
          </el-descriptions-item>
        </el-descriptions>
      </el-card>

    </el-skeleton>
    <el-skeleton :loading="loading" animated>
      <el-card class="mt-8px">
        <template #header>
          <div class="h-3 flex justify-between">
            <span>报告列表</span>
          </div>
        </template>
        <el-table v-loading="loading" :data="list">
          <el-table-column align="center" label="序号" type="index" width="100" />
          <el-table-column align="center" label="报告名称" prop="name" />
          <el-table-column align="center" label="报告类型" prop="type" />
          <el-table-column align="center" label="更新时间" prop="updateTime" />
          <el-table-column :width="300" align="center" label="操作">
            <template #default="scope">
              <el-button link type="primary" @click="handleView(scope.row.url)">
                查看
              </el-button>
              <el-link :href="scope.row.url" :underline="false" download target="_blank" type="primary" style="margin: -2px 0 0 12px">
                导出
              </el-link>
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页 -->
        <Pagination v-model:limit="queryParams.pageSize" v-model:page="queryParams.pageNo" :total="total"
          @pagination="getList" />
      </el-card>
    </el-skeleton>
    
    <ViewPdf ref="viewPdf" />
  </div>
</template>

<script setup lang="ts">
import ViewPdf from './viewPdf.vue'
const loading = ref(false)
const total = ref(0) // 列表的总页数
const list = ref([] as any) // 列表的数据
const viewPdf = ref()
const queryParams = reactive({
  pageNo: 1,
  pageSize: 10
})
const getList = () => {
  list.value = [{
    name: 'geovisApps',
    type: 'pdf',
    updateTime: '2024-06-13',
    url: import.meta.env.VITE_BASE_PATH+'geovisApps.pdf'
  }]
}

const handleView = (url) => {
  viewPdf.value.open(url)
}

onMounted(() => {
  getList()
})
</script>

<style scoped></style>
